package acitivity;

import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.os.IBinder;
import android.provider.Settings;

import com.blankj.utilcode.util.AppUtils;
import com.google.gson.Gson;


import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;
import com.tencent.mmkv.MMKV;
import com.xiekun.myapplication.R;

import java.lang.reflect.Type;

import Entity.SetActivityBean;
import Entity.UserData;
import Entity.UserEntity;
import adapter.Gloading;
import adapter.GlobalAdapter;
import base.NetBase;
import control.TaskNotificationManager;
import service.TaskManageNotificationService;
import util.Constant;
import util.UtilX;


public class MyApplication extends Application {

    private static MyApplication mApplication=null;
    public static boolean isDebug=false;
    public static String uniqueId = "";
    public static  MyApplication getApplicationInstance() {
        return mApplication;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        init();
        mApplication=this;
    }

    private void init(){
        Logger.addLogAdapter(new AndroidLogAdapter());

        isDebug=true;
        UtilX.LogX("-----------init");
        Gloading.initDefault(new GlobalAdapter());
        String rootDir = MMKV.initialize(this);
        NetBase.getInstance().baseInit(AppUtils.getAppVersionName(),AppUtils.getAppVersionCode()+"",!isDebug,
                this);
        uniqueId = Settings.System.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
    }

}
